package com.hefeng.wx.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hefeng.wx.domain.WxDeviceUser;
import com.hefeng.wx.mapper.WxDeviceUserMapper;
import com.hefeng.wx.service.WxDeviceUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 设备绑定表;(wx_device_user)表服务实现类
 * @author : hzh
 * @date : 2022-10-17
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class WxDeviceUserServiceImpl extends ServiceImpl<WxDeviceUserMapper, WxDeviceUser>  implements WxDeviceUserService {
    @Autowired
    WxDeviceUserMapper wxDeviceUserMapper;
    /**
     * 方法说明: 根据code查询设备关联信息
     * @param deviceCode
     * @return null
     * @Author: huzh
     * @Date: 2022/10/17
     */
    @Override
    public List<WxDeviceUser> getDeviceUserList(String deviceCode) {
        LambdaQueryWrapper<WxDeviceUser> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(WxDeviceUser::getDeviceCode,deviceCode);
        List<WxDeviceUser> dataList=wxDeviceUserMapper.selectList(queryWrapper);
        return dataList;
    }
}
